<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>乐山乐水，乐在十堰</title>
    <link rel="stylesheet" href="fontawesome-5.5/css/all.min.css" />
    <link rel="stylesheet" href="slick/slick.css">
    <link rel="stylesheet" href="slick/slick-theme.css">
    <link rel="stylesheet" href="magnific-popup/magnific-popup.css">
    <link rel="stylesheet" href="css/bootstrap.min.css" />
    <link rel="stylesheet" href="css/tooplate-infinite-loop.css" />
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.0/font/bootstrap-icons.css">
    <?php
    header("Cache-Control: no-cache, must-revalidate");
    require("config.php");

    $DB = mysqli_connect($dbHost, $dbUserName, $dbPassword); //数据库端口的连接
    mysqli_select_db($DB, $dbName); //连接数据库
    mysqli_query($DB, "set name 'utf-8'"); //查询语句设置字符集

    $id = $_GET['id'];
    //$id = 7;
    $str = "select * from 景点 where id = $id";
    $result = mysqli_query($DB, $str);

    while ($row = mysqli_fetch_array($result)) {
        $arr = $row;
    };
    ?>
    <style>
        p {
            text-indent: 2em;
        }
    </style>
</head>

<body>
    <!-- Hero section -->
    <div class="tm-font-big tm-parallax">
        <div class="tm-next">
            <a href="index.php#map_container">乐山乐水，乐在十堰</a>
        </div>
        <div class="row">
            <div class="col-lg-12 tm-content-box">
                <h2 class="text-center mb-4 tm-section-title"><?php echo $arr['attraction_name']; ?></h2>
                <div class='text-center'>
                    <img src="<?php echo $arr['image_path']; ?>" alt="Image 1" width="600px" height="auto">
                </div>
            </div>
            <div class="row">
                <div class="col-sm"></div>
                <div class="col-sm-10 tm-content-box">
                    <p><?php echo $arr['Introduction']; ?></p>
                    <?php $de_str = $arr['detail_introduction'];
                    $arr_str = explode("\n", $de_str);

                    foreach ($arr_str as $key => $value) { ?><p><?php echo $value; ?></p><?php } ?>


                </div>
                <div class="col-sm"></div>
            </div>
        </div>
    </div>
    </div>
</body>